//
//  AppDelegate.m
//  PTSTest
//
//  Created by 黄杰 on 15/11/4.
//  Copyright © 2015年 黄杰. All rights reserved.
//

#import "AppDelegate.h"
#import "IndexViewController.h"
#import "ChatViewController.h"
#import "DemandViewController.h"
#import "CustomViewController.h"
#import "MyViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    // 初始化UIWindow
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    
    self.window.backgroundColor = [UIColor whiteColor];
    
    [self.window makeKeyAndVisible];
    
    // 创建tabBar
    PTSTabBarViewController *tabBar = [[PTSTabBarViewController alloc] init];
    
    // 设置字体颜色
    [tabBar setupTitleColor:[UIColor colorFormHexRGB:@"a6a6a6"] selectedColor:[UIColor colorFormHexRGB:@"0185d0"]];
    
    // 设置顶部线条颜色
    [tabBar setupLineColor:[UIColor colorFormHexRGB:@"dedede"]];
    
    // 标题数组
    NSArray *titleArray = @[@"首页", @"沟通组", @"需求", @"客户", @"我的"];
    // controller数组
    IndexViewController *index = [[IndexViewController alloc] init];
    ChatViewController *chat = [[ChatViewController alloc] init];
    DemandViewController *demand = [[DemandViewController alloc] init];
    CustomViewController *custom = [[CustomViewController alloc] init];
    MyViewController *my = [[MyViewController alloc] init];
    NSArray *vcArray = @[index, chat, demand, custom, my];
    // 正常状态下图片数组
    NSArray *norArray = @[@"btn2", @"btn2", @"btn2", @"btn2", @"btn2"];
    // 选中状态下图片数组
    NSArray *selectedArray = @[@"btn2", @"btn2", @"btn2", @"btn2", @"btn2"];
    
    // 创建底部item按钮
    [tabBar setupSubViesWithTitleArray:[titleArray mutableCopy] VcNameArray:[vcArray mutableCopy] NormalImgArray:[norArray mutableCopy] SelectedImgArray:[selectedArray mutableCopy]];
    
    // 让tabBar成为根控制器
    self.window.rootViewController = tabBar;
    
    return YES;
}

@end
